package com.mall.controller;

import com.mall.pojo.Result;
import com.mall.service.bannerService;
import com.mall.service.homeGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException;

//轮播图
@RestController
public class homeGoodsController  {
    @Autowired
    private homeGoodsService goodsService;
    @RequestMapping("/home/hot")
    public Result findHot() {
        return Result.success(goodsService.goodsHot());
    }
    @RequestMapping("/home/new")
    public Result findNew() {
        return Result.success(goodsService.goodsNew());
    }
    @RequestMapping("/goods/{id}")
    public Result findDetail(@PathVariable int id) {
        return Result.success(goodsService.getGoodById(id));
    }


}

